<extend name="Public:Base" />
<block name="title">
    <title>美住 - 客栈申请</title>
</block>
<block name="extendHead">
    <link rel="stylesheet" href="__PUBLIC__/src/meizhu/Dealer/index.css"/>
    <link rel="stylesheet" href="__PUBLIC__/jslib/bootstrap-datepicker/css/bootstrap-datepicker.min.css" />
</block>
<block name="document">
    <div id="doc" data-side-menu-id="sideMenuDealerApply" data-side-menu-toggle-id="collapseDealerToggle">
        <div id="doc-header">
            <include file="Public:Include_navbar" />
        </div>
        <div id="doc-center">
            <div class="container">
                <div class="col-xs-3-15">
                    <include file="Public:Include_sideMenu" />
                </div>
                <div class="col-xs-12-15">
                    <nav class="navbar navbar-default navbar-custom-fitin">
                        <div class="container-fluid">
                            <p class="navbar-text custom-navber-text">经销商申请列表</p>
                        </div>
                    </nav>
                    <nav class="navbar navbar-default navbar-custom-fitin nav-padding">
                        <div class="container-fluid">
                            <div class="collapse navbar-collapse">
                                <form id="searchForm" action="" method="post" >
                                    <div class="form-group">
                                        <!--  <label class="col-xs-1 control-label">客栈名称</label> -->
                                        <div class="col-xs-3">
                                            <input type="text" value="{$condition.k}" class="form2-control col-xs-6"  placeholder="联系人、手机号"  name="k"  />
                                        </div>
                                        <div class="col-xs-2">
                                            <input href="javascript:void(0);" class="btn btn-default btn-sm  glyphicon glyphicon-search"  value='查找' type='submit' ></input>
                                        </div>
                                        {: echoSearch()}
                                    </div>
                                </form>
                            </div>
                        </div>
                    </nav> 
                    <div class="well well-custom-has-navbar">
                        <div class="well-custom-body">
                            <div class="table-responsive">
                                <table class="table table-bordered table-hover" id="questionTalbe">
                                    <thead>
                                        <tr>
                                            <th>申请人</th>
                                            <th>区号</th>
                                            <th class="col-xs-2">联系方式</th>
                                            <th>申请时间</th>
                                            <th>申请状态</th>
                                            <th>详情</th>
                                            <th class="col-xs-3">操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    <foreach name="applyData" item="vo">
                                        <tr>
                                            <td>{$vo.name}</td>
                                            <td>{$vo.areacode}</td>
                                            <td>+{$vo.areacode} {$vo.mobile}</td>
                                            <td>{$vo.createtime|substr=0,10}</td>
                                            <td>{:getApplyStatus($vo['status'])}</td>
                                            <td><button class="btn btn-link btn-sm detail" data-toggle="modal" data-json='{:json_encode($vo);}' data-target="#detailModel">查看</button></td>
                                            <td>
                                        <if condition="$vo['status'] eq 0">
                                            <button class="btn btn-default btn-sm pass" data-toggle="modal" data-json='{:json_encode($vo);}' data-target="#passModel">开通</button>
                                            <button class="btn btn-danger btn-sm confuse" data-toggle="modal" data-value='{$vo.id}' data-target="#confuseModel">拒绝</button>
                                            <elseif condition="$vo['status'] eq 2" />
                                            <button class="btn btn-default btn-sm pass" data-toggle="modal" data-json='{:json_encode($vo);}' data-target="#editModel">开通</button>
                                        </if>

                                        </td>
                                        </tr>
                                    </foreach>
                                    <tr class="padtopx"><td colspan="6">{$page}</td></tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

        </div>

        <div id="doc-footer">
            <include file="Public:Include_footer" />
        </div>
    </div>
    <div class="modal fade" id="detailModel">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                    </button>
                    <h4 class="modal-title">申请人详情</h4>
                </div>
                <div class="modal-body">
                    <div class="form-container">
                        <div class="custom-form-body">
                            <form class="form-horizontal">
                                <div class="form-group">
                                    <label class="col-xs-3 control-label">姓名：</label>
                                    <div class="col-xs-6" id="name" style="padding-top: 7px">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-xs-3 control-label">区号</label>
                                    <div class="col-xs-6" id="areacode" style="padding-top: 7px">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-xs-3 control-label">联系方式：</label>
                                    <div class="col-xs-6" id="mobile" style="padding-top: 7px">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="requestEditUserName" class="col-xs-3 control-label">证件号：</label>
                                    <div class="col-xs-6" id="idcard" style="padding-top: 7px">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="requestEditUserName" class="col-xs-3 control-label">证件照</label>
                                    <div class="col-xs-9" style="padding-top: 7px">
                                        <img src="" id="idcardpath" class="col-xs-12">
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="modal fade" id="passModel">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" id="requestCannel" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                    </button>
                    <h4 class="modal-title">确定状态</h4>
                </div>
                <div class="modal-body">
                    <form id="enddateForm" action="" method="post" >
                        <div class="form-group">
                            <label for="requestEnddate" class="col-xs-3 control-label"><span style="color:red">*</span>到期时间：</label>
                            <div class="col-xs-6">
                                <input type="text" class="form-control" id="requestEnddate">
                            </div>
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-success" data-value="" id="requestPass">开通</button>
                </div>
            </div>
        </div>
    </div>
    <div class="modal fade" id="confuseModel">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" id="requestCannel" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                    </button>
                    <h4 class="modal-title">确定状态</h4>
                </div>
                <div class="modal-body">
                    <h3>您确定要<span class="text-danger">将你选择的账号更改为拒绝？</span></h3>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-danger" data-value="" id="requestConfuse">确定</button>
                </div>
            </div>
        </div>
    </div>

    <!--end of doc-->
</block>

<block name="extendFootJs">
    <script type="text/javascript" src="__PUBLIC__/src/meizhu/common.js"></script>    
    <script type="text/javascript" src="__PUBLIC__/uclbrt/js/jquery-plugin/tooltip.js"></script>
    <script type="text/javascript" src="__PUBLIC__/src/meizhu/Dealer/index.js?112"></script>
    <script type="text/javascript" src="/Public/jslib/bootstrap-datepicker/js/bootstrap-datepicker.min.js"></script>
</block>

